package org.zh.client.tra_aop;

import java.time.Instant;


public class RemoteTransactionBean {
    private String Global_TX_ID;  //全局事务ID
    private String ROOT_URL;  //注册中心地址
    private boolean isCanRollback;  //是否开启了本地事务 是否对数据库进行了操作  用来判断用不用回滚
    private String nodeURI;  //本节点IP地址   回滚接口
    private int nodeStatus;  // 本节点方法是否执行完成
    private boolean commit;  // 服務器通知回滾字段
    private Instant createTime;

    public RemoteTransactionBean(String global_TX_ID, String ROOT_URL, boolean isCanRollback, String nodeURI, int nodeStatus) {
        this.Global_TX_ID = global_TX_ID;
        this.ROOT_URL = ROOT_URL;
        this.isCanRollback = isCanRollback;
        this.nodeURI = nodeURI;
        this.nodeStatus = nodeStatus;
        this.createTime = Instant.now();
    }

    public RemoteTransactionBean() {
    }

    public String getGlobal_TX_ID() {
        return Global_TX_ID;
    }

    public void setGlobal_TX_ID(String global_TX_ID) {
        Global_TX_ID = global_TX_ID;
    }

    public String getROOT_URL() {
        return ROOT_URL;
    }

    public void setROOT_URL(String ROOT_URL) {
        this.ROOT_URL = ROOT_URL;
    }

    public boolean isCanRollback() {
        return isCanRollback;
    }

    public void setCanRollback(boolean canRollback) {
        isCanRollback = canRollback;
    }

    public String getNodeURI() {
        return nodeURI;
    }

    public void setNodeURI(String nodeURI) {
        this.nodeURI = nodeURI;
    }

    public int getNodeStatus() {
        return nodeStatus;
    }

    public void setNodeStatus(int nodeStatus) {
        this.nodeStatus = nodeStatus;
    }

    public boolean isCommit() {
        return commit;
    }

    public void setCommit(boolean commit) {
        this.commit = commit;
    }

    public Instant getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Instant createTime) {
        this.createTime = createTime;
    }
}
